home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / wc_vesa2 / test.c < prev   
Encoding:
C/C++ Source or Header  |  1996-11-26  |  1.6 KB  |  53 lines

  1. //╔══════════════════════════════════════════════════════════════════════════╗
  2. //║                                                                          ║
  3. //║ This example show how to use the Linear FrameBuffer with Vesa 2.0        ║
  4. //║                                                                          ║
  5. //║                                                                          ║
  6. //║                                                                          ║
  7. //╚══════════════════════════════════════════════════════════════════════════╝
  8.  
  9. #include <process.h>
  10. #include "..\resource\eos.h"
  11.  
  12. void copyvideo(char *Addr_Buffer,char *Addr_File);
  13. #pragma aux copyvideo modify [eax edx esi edi] parm [edi] [esi] =  \
  14.    "add esi,10"\
  15.    "mov edx,3c8h"\
  16.    "xor al,al"\
  17.    "out dx,al"\
  18.    "inc dl"\
  19.    "mov ecx,768"\
  20.    "@@Ok1:"\
  21.    "lodsb"\
  22.    "out dx,al"\
  23.    "loop @@Ok1"\
  24.    "mov ecx,76800"\
  25.    "rep movsd";
  26.  
  27. void wait_();
  28. #pragma aux wait_ modify [eax]=  \
  29.    "xor ah,ah"\
  30.    "int 16h";
  31.  
  32. void test_vesa2()
  33. {
  34.    char *Addr_Buffer;
  35.    char *Addr_File;
  36.    long Size_File;
  37.  
  38.     Addr_Buffer=Init_Vesa2(0x101,640*480);
  39.     if ( Addr_Buffer==Off )
  40.     Exit_Error ("    ■ Mode SVGA not supported or VESA not found ! \x0D\x0A" \
  41.                 "      To install a vesa driver, refer to your video card documentation. \x0D\x0A\x24");
  42.     Addr_File=Load_Internal_File ("..\\DATA\\TEST640.DLZ",&Size_File);
  43.     copyvideo(Addr_Buffer,Addr_File);
  44.     wait_();
  45.     Restore_Video_Mode();
  46. }
  47.  
  48. void main(int argn, char **argv)
  49. {
  50.     Init_EOS();
  51.     test_vesa2();
  52.   exit (0);
  53. }